<?php
include ('class/config.php');
include ("function/frmValidation.php");
include ('class/cls_contact.php');
include ("class/cls_category.php");
include ("class/cls_course.php");
include ("class/cls_story.php");
include("class/cls_university.php");


$err=0;
$err_msg="";
if (isset($_POST['send'])) {
	$cont_name = trim($_POST['contact_name']);
	$cont_subject = trim($_POST['contact_subject']);
	$cont_email = trim($_POST['contact_email']);
	$email_valid=emailValidation($cont_email);
	if($email_valid !="true" || $email_valid>255)
	{
		$err++;
		$err_msg="Invalid Email Format !";
	}
	$cont_message = $_POST['contact_message'];
	$date = date("Y-m-d");
	if($err==0)
	{
	$objContact -> addContact($cont_name, $cont_email, $cont_subject, $cont_message, $date);
	}
}
?>
<!DOCTYPE html>
<html>
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
		<meta name="viewport" content="width=device-width, initial-scale=1.0" />
		<title>Mission USA | Contact Us</title>

		<link rel="stylesheet" type="text/css" href="css/jquery.bxslider.css" />
		<link href="css/style.css" rel="stylesheet" type="text/css" />
		<link href="images/icon.png" rel="icon" />
		<!-- <link href="http://fonts.googleapis.com/css?family=Roboto:100,300,400,700,500" rel="stylesheet" type="text/css" /> -->
		<script type="text/javascript" src="lib/frmValidation.js"></script>
		<script type="text/javascript" src="js/jquery.1.8.2.js"></script>
		<script src="js/jquery.bxslider.js"></script>
		<script type="text/javascript">
			$(document).ready(function() {
				$('#bxslider').bxSlider({
					mode : 'fade',
					auto : true,
					speed : 2000,
					pause : 5000
				});
				$('#bxcarousel').bxSlider({
					auto : true,
					pause : 3000,
					pager : false,
					slideMargin : 20
				});
			});
		</script>
		<!--[if IE]><script type="text/javascript" src="js/html5shiv.min.js"></script><![endif]-->
	</head>
	<body>
		<?php
		include ("includes/header.php");
		?>
		<main id="main" role="main">
			<div class="main-frame">
				<div class="main-frame-holder">
					<article class="col">
					<h1>Contact Form</h1>
					<p><?php  
					if (isset($err_msg))
					echo $err_msg;
						?></p>
					<form method="post" action="" name="contactForm" id="contactForm" onsubmit="return contactValid()">
						<table border="0" cellpadding="1" cellspacing="1" class="table">
							<tr>
								<td width="30%">Name</td>
								<td>
								<input type="text" name="contact_name" id="contac_name" class="textBox">
								</td>
							</tr>
							<tr>
								<td width="30%">Subject</td>
								<td>
								<input type="text" name="contact_subject" id="contact_subject" class="textBox">
								</td>
							</tr>
							<tr>
								<td width="30%">Email</td>
								<td>
								<input type="text" name="contact_email" id="contact_email" class="textBox">
								</td>
							</tr>
							<tr>
								<td width="30%">Message</td>
								<td><textarea rows="5" cols="50" name="contact_message" id="contact_message" class="textBox"></textarea></td>
							</tr>
							<tr>
								<td>&nbsp;</td>
								<td>
								<input type="submit" name="send" id="send" value="Send">
								</td>
							</tr>
						</table>
					</form>
					<!--<p>
					The houses having low fronts, and being adorned with verandas, beneath which he caught glimpses of neat peristyles.  This quarter occupied, with its streets, squares, docks, and warehouses, all the space between the "promontory of the Treaty" and the river. European quarter, the houses having low fronts, and being adorned with verandas, beneath which he caught of neat peristyles. This quarter occupied, with its streets, squares, docks, and warehouses, all the space between the "promontory of the Treaty" and the river. European quarter, the houses having low fronts, and being adorned with verandas, beneath which he caught glimpses of neat peristyles. This quarter occupied, with its streets, squares, docks, and warehouses, all the space between the "promontory of the Treaty" and the river. European quarter, the houses having low fronts, and being adorned with verandas, beneath which he caught glimpses of neat peristyles. This quarter occupied, with its streets, squares, docks, and warehouses, all the space between the "promontory of the Treaty" and the river. European quarter, the houses having low fronts.
					</p>-->
					</article>
					<aside class="col">
					<h2>Contact Info</h2>
					<h3>Adress :</h3>
					<pre><?php echo _GPO_BOX_ ?></pre>
					<pre><?php echo _ADDRESS_?></pre>
					<h3>Phone Number :</h3>
					Tel : <pre><?php echo _PHONE_TEL_?></pre>
					Mob : <pre><?php echo _PHONE_MOB_?></pre>
					<h3>Email :</h3>
					<pre><?php echo _EMAIL_?></pre>
					
					<!--<div class="facebook">
						
					<iframe src="//www.facebook.com/plugins/likebox.php?href=https%3A%2F%2Fwww.facebook.com%2Fnepaleducenter&amp;width=300&amp;height=258&amp;colorscheme=light&amp;show_faces=true&amp;header=false&amp;stream=false&amp;show_border=false" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:300px; height:258px;" allowTransparency="true"></iframe>-->
					</div>
					</aside>
					
				</div>
			</div>
			<div class="main-block">
				<div class="threecolumns">
					<?php
					include ("includes/successStory.php");
					?>
					<?php
						include ("includes/courses.php");
					?>
					<section class="col">
						<h2>Advertisement</h2>
						<div class="block advertise">
							<img src="pictures/advertisement/laligurans.jpg" alt="college ad">
						</div>
					</section>
				</div>
			</div>
			<?php
				include ("includes/downSlider.php");
			?>
		</main>
		<?php
			include ("includes/footer.php");
		?>
	</body>
</html>
